x11: Handle case where clipboard was reclaimed quickly
authorBenjamin Otte <otte@redhat.com>
Fri, 1 Dec 2017 06:42:36 +0000 (07:42 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 3 Dec 2017 04:46:49 +0000 (05:46 +0100)
commitead67a7c17f25a424507bb3d87b66325af0ae4b3
tree313bf6a68c8f7a560a1564e75af9292288ae596f
parent24c934f8c00ae20e87de06f046775d18450f6677
x11: Handle case where clipboard was reclaimed quickly

When the reply to a TARGETS request comes in, the clipboard may already
be reclaimed by the local app. Deal with that case (in an ugly way,
strictly speaking we should use a cancellable here).

This happens for example at startup when the initial TARGETS requests
have not been answered until after the main widow popped up. And if such
a window immediately claims the primary clipboard (like when the initial
focus is inside an entry), this race will happen.
gdk/x11/gdkclipboard-x11.c